from ronglian_sms_sdk import SmsSDK
from celery_meiduo.main import app

@app.task
def celery_send_sms_code(mobile,sms_code,time):
    accId = '8aaf070878d419aa017903020b4a12fd'
    accToken = 'e3a3e11b49124abe9ad2563f722471d7'
    appId = '8aaf070878d419aa017903020c2b1304'

    sdk = SmsSDK(accId, accToken, appId)

    # 2. 调用发送短信的方法
    """
    tid	    String	短信模板 ID
    mobile	String	发送手机号，多个以英文逗号分隔，最多 200 个号码
    datas	tuple	替换短信模板占位符的内容变量
    """
    tid = '1'
    mobile = '{}'.format(mobile)
    datas = (sms_code, time)

    sdk.sendMessage(tid, mobile, datas)